<%--
 *  File:    ExpertSummary.jsp
 *  @Author: TerryCui
 *  Date:    2011.1.12

 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="http://dcms.oval.com/page/dcms" prefix="dcms" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
String strModuleName = "AL";
String privilegeCode = "10905";
String contextPath = request.getContextPath();
%>
<%@include file="/inc/PageDefault.inc"%>
<%@include file="/inc/FrmDefault.inc"%>
<html>
<head>
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/<%= strLanguageCode %>/summary.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>
<script language="JavaScript">
//salesman
function popRep() {
	var regionid=__otherSearchConditionForm.regionid.value;
	var proviceofficecode = __otherSearchConditionForm.proviceofficelist.value;
	var businessareacode = __otherSearchConditionForm.businessarealist.value;
	
	//alert(regionid+"|"+proviceofficecode+"|"+businessareacode+"|");
	var status = "height=400, width=600, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
	var url = "<%=contextPath%>/tdr/dataverify/SalesPopWindow.jsp?<%= OvalTools.randomURL() %>&regionid="+regionid+"&proviceofficecode="+proviceofficecode+"&businessareacode="+businessareacode;
	popwindow = window.open(url, "newwindow", status);
  }

function SetSalesMan(id,code,name){
	__otherSearchConditionForm.userids.value=id;
	__otherSearchConditionForm.employeecode.value=code;
	__otherSearchConditionForm.employeename.value=name;
}


function page_clear(){
	__otherSearchConditionForm.regionid.value="";
	__otherSearchConditionForm.proviceofficelist.value="";
	__otherSearchConditionForm.businessarealist.value="";
	__otherSearchConditionForm.userids.value="";
	__otherSearchConditionForm.employeecode.value="";
	__otherSearchConditionForm.employeename.value="";
	
}


//getsecond 
function page_getpriviceoffice(){
	var objdeptcode=eval("__otherSearchConditionForm.regionid");
	if (objdeptcode==""){
	    return;
	}
	var  datahandler = new  DataHandler();
	datahandler.add_params("regionid" , objdeptcode.value , "Integer");
	datahandler.getResultFromVector("resultproviceoffice","proviceofficename","proviceofficecode","__otherSearchConditionForm.proviceofficelist");
	datahandler.add_job("j_yorndoctorconfsummary");
	datahandler.runDataHandler();
}



function page_getbusinessarea(){
	var objdeptcode=eval("__otherSearchConditionForm.proviceofficelist");
	var regionid = __otherSearchConditionForm.regionid.value;
	if (objdeptcode==""){
	    return;
	}
	var  datahandler = new  DataHandler();
	datahandler.add_params("regionid" , regionid , "Integer");
	datahandler.add_params("proviceofficelist" , objdeptcode.value , "String");
	datahandler.getResultFromVector("resultbusinessarea","businessareaname","businessareacode","__otherSearchConditionForm.businessarealist");
	datahandler.add_job("j_yorndoctorconfsummary");
	datahandler.runDataHandler();
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

 <%
 String BasicInfoName=label.getLabelName("L_BasicInfo");
 %>

<dcms:summary id="al.expertsummary" summaryDataName="searchresults" needExportXLSX="true">
  <dcms:param name="category" property="params:category"/>
  <dcms:otherSearchCondition>
     <iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
     <table width="1000" border="0" cellspacing="0" >
        	<tr>
        		<% 
        		HashMap userinfo = (HashMap)session.getAttribute("userinfo");
        		 Integer  issalesman = (Integer) userinfo.get("issalesman");
        		 	if(!"1".equals(issalesman)) {
	                %> 
	                <tr>
	                <td style="width:40px;">&nbsp;</td><td style="width:150px;">&nbsp;</td>
	               <td style="width:40px;">&nbsp;</td><td style="width:150px;">&nbsp;</td>
	               <td style="width:40px;">&nbsp;</td><td style="width:150px;">&nbsp;</td>
	               <td style="width:60px;">&nbsp;</td><td style="width:150px;">&nbsp;</td>
	               <td style="width:60px;">&nbsp;</td><td style="width:150px;">&nbsp;</td>
	               </tr>
	                <%}else{ %>
        	    <tr>
                <td style="width:40px;" class="td_right"><%=label.getLabelName("L_Businessarea") +  label.getLabelName("L_Colon") %></td>
        	  	<td style="width:160px;" class="td_left"><custom:select property="regionid" optionInnerTextKey="regionname" style="width:160px" optionsName="resultregion" optionValueKey="regionid" onchange="page_getpriviceoffice()" defaultValue="ALL" defaultValueCost=""/></td>
        	    <td style="width:40px;" class="td_right"><%=label.getLabelName("L_ProvinceOffice") +  label.getLabelName("L_Colon") %></td>
				<td style="width:150px;" class="td_left">
					<custom:select property="proviceofficelist" optionInnerTextKey="proviceofficename" optionsName="resultproviceoffice" optionValueKey="proviceofficecode" defaultValue="----------" style="width:150px" defaultValueCost="" onchange="page_getbusinessarea();"/>
		        </td>
			    <td style="width:60px;" class="td_right"><%=label.getLabelName("L_BusinessAreaName") +  label.getLabelName("L_Colon") %></td>
				<td style="width:180px;" class="td_left">
				<custom:select property="businessarealist" optionInnerTextKey="businessareaname" optionsName="resultbusinessarea" optionValueKey="businessareacode" defaultValue="----------" style="width:180px" defaultValueCost=""/> </td>
        	     <td style="width:60px;" class="td_right"><%=label.getLabelName("L_BusinessContact") +  label.getLabelName("L_Colon") %></td>
				<td style="width:150px;">
			  <custom:text property="employeename" size="20" readonly="true" style="border:1px #7F9DB9 solid;"/>
			  <a onClick="javascript:popRep();"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a> 
			  <custom:hidden property="userids"/>
			  <custom:hidden property="employeecode"/>
		       </td>
				<td><button type="button" onclick="page_clear()" class="button1" name="re" value="clear" style="width:60"><%=label.getLabelName("L_Clear") %></button></td>
			<%}%>
        	</tr>
          </table>
  </dcms:otherSearchCondition>  
  <dcms:summaryTab id="mainTab" name="<%=BasicInfoName%>"  href="/phap/masterdata/expert/ExpertEdit.jsp"/>
</dcms:summary>

</body>
<script>
  document.getElementById("__searchvalue").onkeydown=function seachKeyDown()
  {
   // alert(event.keyCode);
    if(event.keyCode==13)
    {
      __summaryGo(document.getElementById("__summaryConfigID").value,document.getElementById("__indicatorImagePath").value,document.getElementById("__summaryRootPath").value,'');
    }
  }
</script> 
</html>